<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var arr = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i']
    /* for  in   
    可以遍历数组+对象
     */
    // for (var i in arr) {
    //   console.log(arr[i], 999);
    // }

    /* for  of
    可以遍历数组
    不能遍历对象
    */
    // for (var v of arr) {
    //   console.log(v, 666);
    // }

    var obj = {
      name: 'jack',
      age: 18
    }

    // for (var k in obj) {
    //   console.log(obj[k], 8888);
    // }
    for (var v of obj) {
      console.log(v, 777);
    }


  </script>
</body>

</html>